<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class App extends Model
{
    use HasDateTimeFormatter,SoftDeletes;   
    protected $table = 'apps';
    protected $fillable = ['name','icon','d','ext','s','deleted_at'];
        public function getIconAttribute() {
        $file=$this->attributes['icon'];
        $inx = strstr($file, 'http');
        if (!$inx){
            return  config('app.url').'/uploads/'.$file;
        }
        return $file;
    }
    
 }

